package ru.rchervot.sanasar.client.view;

import ru.rchervot.sanasar.client.model.filters.Filter;
import ru.rchervot.sanasar.client.model.filters.FilterFullText;

import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.TextArea;

public class FilterFullTextView extends AbstractFilterView implements FilterFullTextPresenter.Display {
	
	private final TextArea textArea = new TextArea();
	
	public FilterFullTextView(String filterName,
			String filterNameHuman) {
		super(filterName, filterNameHuman);
		
		SimplePanel contentPanel = new SimplePanel();
		contentPanel.setStylePrimaryName("AbstractFilterView_pContent");
				
		textArea.setStylePrimaryName("FilterFullTextView_textArea");
		textArea.setVisibleLines(3);
		
		contentPanel.add(textArea);
		
		setContent(contentPanel);
	}

	@Override
	public void renderFilter(Filter f) {
		FilterFullText filter = (FilterFullText)f;
		
		textArea.setText(filter.getFtsQuery());
	}
}
